/**
 * 叉
 * @param radio 画布大小比例
 * @param color 颜色
 * @returns 数据地址
 */
const CrossImage = (radio?: number, color?: string) => {
    const r = radio || 1;
    const col = color || '#ffffff';
    const canvas = document.createElement('canvas');
    canvas.width = canvas.height = 40 * r;
    const ctx = canvas.getContext('2d')!;

    ctx.save();
    ctx.strokeStyle = "rgba(0,0,0,0)";
    ctx.miterLimit = 4;
    ctx.fillStyle = col;
    ctx.scale(0.039, 0.039);
    ctx.save();
    ctx.beginPath();
    ctx.moveTo(886.528 * r, 908.032 * r);
    ctx.bezierCurveTo(858.432 * r, 936.128 * r, 812.672 * r, 936.128 * r, 784.512 * r, 908.032 * r);
    ctx.lineTo(138.304 * r, 261.824 * r);
    ctx.bezierCurveTo(110.208 * r, 233.664 * r, 110.144 * r, 187.968 * r, 138.304 * r, 159.808 * r);
    ctx.bezierCurveTo(166.336 * r, 131.648 * r, 212.096 * r, 131.648 * r, 240.384 * r, 159.808 * r);
    ctx.lineTo(886.528 * r, 805.952 * r);
    ctx.bezierCurveTo(914.624 * r, 834.24 * r, 914.752 * r, 879.872 * r, 886.528 * r, 908.032 * r);
    ctx.lineTo(886.528 * r, 908.032 * r);
    ctx.closePath();
    ctx.moveTo(885.76 * r, 261.504 * r);
    ctx.lineTo(239.616 * r, 907.648 * r);
    ctx.bezierCurveTo(211.392 * r, 935.872 * r, 165.696 * r, 935.872 * r, 137.536 * r, 907.648 * r);
    ctx.bezierCurveTo(109.376 * r, 879.552 * r, 109.376 * r, 833.92 * r, 137.6 * r, 805.632 * r);
    ctx.lineTo(783.744 * r, 159.552 * r);
    ctx.bezierCurveTo(811.968 * r, 131.392 * r, 857.728 * r, 131.392 * r, 885.76 * r, 159.488 * r);
    ctx.bezierCurveTo(913.984 * r, 187.648 * r, 913.856 * r, 233.344 * r, 885.76 * r, 261.504 * r);
    ctx.lineTo(885.76 * r, 261.504 * r);
    ctx.closePath();
    ctx.fill();
    ctx.stroke();
    ctx.restore();

    return canvas.toDataURL('image/png');
}


export { CrossImage };